package com.xkdx.guangguang.fragment.shop.uploadphoto;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.http.entity.mime.content.FileBody;

import android.os.Environment;

import com.xkdx.guangguang.module.network.AbsAction;

public class BrandUploadPhotoAction extends AbsAction {
	String userID, loginToken, brandID, GalleryID, photoTitle;

	public BrandUploadPhotoAction(String userID, String loginToken,
			String brandID, String GalleryID, String photoTitle) {
		this.userID = userID;
		this.loginToken = loginToken;
		this.brandID = brandID;
		this.GalleryID = GalleryID;
		this.photoTitle = photoTitle;
		key = 1;
		fileBody = new FileBody(new File(
				Environment.getExternalStorageDirectory()
						+ "/GuangGuang/photo/shop.jpg"));
	}

	@Override
	public void constructRequest() {

		HashMap<String, String> map = new HashMap<String, String>();
		map.put("DeviceID", "2");
		map.put("UserID", userID);
		map.put("LoginToken", loginToken);
		map.put("BrandID", brandID);
		map.put("GalleryName", GalleryID);
		map.put("PhotoTitle", photoTitle);
		map.put("Rank", "");
		map.put("Price", "");
		String json = constructJson(map);
		Parameter parameter = new Parameter("galleryInterface",
				"uploadPhotoToBrand", json);

		List<Parameter> list = new ArrayList<Parameter>();
		list.add(parameter);
		requestData = constructMod(list);

	}

}
